var width = $("#nav-menu .active").width();
var left = $("#nav-menu .active").offset().left;

$('#efan').animate({ width: width + 10, left: left}, {duration: 200, queue: false});
 
$('#nav-menu li').hover(
    function(){    
        $('ul.sub-menu', this).slideToggle(200);
        var width = $(this).width();
        var left = $(this).offset().left;
        $('#efan').animate({width: width + 10, left: left}, {duration: 200, queue: false});
    }
);
$('#nav-menu li ul.sub-menu li').hover(
    function(){    
        var width = $(this).parent().parent().width();
        var left = $(this).parent().parent().offset().left;
        $('#efan').animate({width: width + 10, left: left}, {duration: 200, queue: false});
    }
);
$('#nav-menu').hover(function(){},function(){
        var width = $("#nav-menu .active").width();
        var left = $("#nav-menu .active").offset().left;
        $('#efan').animate({ width: width + 10, left: left }, {duration: 200, queue: false});
});
$(window).resize(function(){
        var width = $("#nav-menu .active").width();
        var left = $("#nav-menu .active").offset().left;
        $('#efan').animate({ width: width + 10, left: left }, {duration: 200, queue: false});
});